<template>
  <div id="app">
    <RootNav />
    <div class="content__x">
      <div class="current__router__x">当前页面位置：<span>src/views/{{currentRouter}}/index.vue</span></div>
      <router-view/>
    </div>
  </div>
</template>

<script>
  import RootNav from '@/components/Root/RootNav'

  export default {
    name: 'App',
    components: {
      RootNav
    },
    computed: {
      currentRouter() {
        return this.$route.name
      }
    }
  }
</script>

<style>
html, body, #app {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#app {
  display: flex;
}
.content__x {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}

.current__router__x {
  margin: 4px;
  margin-bottom: 10px;
}

.current__router__x > span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 2px 8px;
  border-radius: 4px;
  background-image: linear-gradient(120deg, #ffafbd 0%, #ffc3a0 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  text-shadow: 1px 1px 4px rgba(176, 106, 179, .8);
}

.page-x { /* 每个页面组件的根标签都设置了该类 */
  width: 100%;
  flex: 1;
  overflow-y: auto;
}
</style>
